package com.landeb.shop.huo;

import android.support.v7.app.AppCompatActivity;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by blade on 2016/11/17.
 */

public class ActControler {

    public static List<AppCompatActivity> mActivities = new ArrayList<>();


    public static void addAct(AppCompatActivity activity) {
        mActivities.add(activity);
    }

    public static void removeAct(AppCompatActivity activity) {
        mActivities.remove(activity);

    }

    public static void removeAllAct() {

        for (AppCompatActivity a : mActivities) {

            a.finish();
        }

    }

    public void removeAllActSkipThis(AppCompatActivity thisAct) {

        for (AppCompatActivity a : mActivities) {

            if (a.equals(thisAct)) {
                continue;
            }
            a.finish();
        }

    }

}
